/**
 *Tab.java
 *@anthor Daniel Liu
 *2006-4-26 2:58:42
 **/
package org.lex.utils.logging.handler;

import java.io.OutputStream;

import javax.swing.JScrollPane;

import org.lex.swing.widgets.OutputStreamTextArea;
import org.lex.utils.Streamable;


public class OutputableTabPane extends JScrollPane implements Streamable {
	private OutputStreamTextArea textArea = null;

	public OutputableTabPane() {
		super();
		initialize();
	}

	public OutputStream getOutputStream() {
		return this.getTextArea().getOutputStream();
	}

	private void initialize() {
		this.setSize(300, 200);
		this.setViewportView(getTextArea());
	}

	private OutputStreamTextArea getTextArea() {
		if (textArea == null) {
			textArea = new OutputStreamTextArea();
			textArea.setAutoScrollText(true);
			textArea.setLineWrap(true);
		}
		return textArea;
	}
}
